Current Location: Home> Function Categories> abs

abs

Absolute value
Name:abs
Category:math
Programming Language:php
One-line Description:Absolute value.

Definition and usage

abs() function returns the absolute value of a number.

Example

 <?php
echo ( abs ( 6.7 ) ) ;
echo ( abs ( - 3 ) ) ;
echo ( abs ( 3 ) ) ;
?>

Try it yourself

grammar

 abs ( x )
parameter describe
x Required. A number.

illustrate

Returns the absolute value of parameter x . If the parameter x is float, the returned type is also float, otherwise the integer is returned (because float usually has a larger range of values ​​than integer).

Similar Functions
  • Combined linear congruent generator lcg_value

    lcg_value

    Combinedlinearcongru
  • Round floating point numbers round

    round

    Roundfloatingpointnu
  • Exponential expressions pow

    pow

    Exponentialexpressio
  • Sow a better random number generator seed mt_srand

    mt_srand

    Sowabetterrandomnumb
  • Further method to sort ceil

    ceil

    Furthermethodtosort
  • Convert decimal to binary decbin

    decbin

    Convertdecimaltobina
  • Antihyperbolic cosine acosh

    acosh

    Antihyperboliccosine
  • Absolute value abs

    abs

    Absolutevalue
Popular Articles